<?php

use think\migration\Migrator;
use think\migration\db\Column;

class AlterCouponOrderAddCreateOrderFrom extends Migrator
{

    public function up()
    {
        $this->table('coupon_order')
            ->addColumn('create_order_from', 'string', ['limit' => 10, 'default' => 'h5', 'comment' => '下单来源 h5 applet 小程序'])
            ->update();
        $this->table('coupon_order_sid')
            ->addColumn('from', 'string', ['limit' => 10, 'default' => 'h5', 'comment' => '下单来源 h5 applet 小程序'])
            ->update();
    }

    public function down()
    {
        $this->table('coupon_order')->removeColumn('create_order_from');
        $this->table('coupon_order_sid')->removeColumn('from');
    }


}
